const reducer = (preState, actions) => {
    let newState = { ...preState }
    switch (actions.type) {
        case 'userInfo':
            newState.userInfo.userName = actions.value
            break
        case 'companyInfo':
            newState.companyInfo.companyName = actions.value
            break
        default:
            return preState
    }
    console.log('preState:', preState)
    console.log('actions:', actions)
}

const initState = {
    userInfo: {
        userName: ""
    },
    companyInfo: {
        companyName: ""
    }
}

export default {
    reducer,
    initState
}